#ifndef __SYSCALL_HOOK_ARM64_H__
#define __SYSCALL_HOOK_ARM64_H__

extern void (*update_mapping_prot)(phys_addr_t phys, unsigned long virt, phys_addr_t size, pgprot_t prot);
extern unsigned long start_rodata, end_rodata;
#define section_size (end_rodata - start_rodata)

static inline void disable_write_protection(void){
	preempt_disable();
	update_mapping_prot(__pa_symbol(start_rodata), (unsigned long)start_rodata, section_size, PAGE_KERNEL);
}

static inline void enable_write_protection(void){
	update_mapping_prot(__pa_symbol(start_rodata), (unsigned long)start_rodata, section_size, PAGE_KERNEL_RO);
	preempt_enable();
}

#endif
